-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement ml_meth as an union. #2166
Conversation
Thanks, this does look a bit nicer than the transmutes. I think this needs a |
impl Default for PyMethodDef { | ||
fn default() -> PyMethodDef { | ||
unsafe { mem::zeroed() } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this default impl makes sense if PyMethodDefPointer is never null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed; I also actually generally don't like having any implementations of traits or methods for pyo3-ffi
types if possible (except for Copy
& Clone
). Makes it closer to the C that they come from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Implements #2129